<script src="<?php echo base_url() . 'assets/js/app/list.js'; ?>"></script>
<link rel="stylesheet" href="<?php echo base_url() . 'assets/js/themes/base/jquery.ui.all.css'; ?>"/>
	<script src="<?php echo base_url() . 'assets/js/jquery-1.9.1.js'; ?>"></script>
	<script src="<?php echo base_url() . 'assets/js/ui/jquery.ui.core.js'; ?>"></script>
	<script src="<?php echo base_url() . 'assets/js/ui/jquery.ui.widget.js'; ?>"></script>
	<script src="<?php echo base_url() . 'assets/js/ui/jquery.ui.datepicker.js'; ?>"></script>
	<script>
		$(function() {
			$("#created_date").datepicker();
		});
	</script>
<?php echo anchor(base_url(),"Home");?>
&nbsp
<?php echo anchor("catalog/Catalog_Controller/create","Create");?>

<!--search meta data-->
<?php echo $meta_search_form;?>
<form action="<?php echo site_url('catalog/Catalog_Controller/delete_all');?>" method="post" onsubmit="return is_check()">
<table>
  <tr>
  	<th><input type="checkbox" onClick="toggle(this)" /></th>
    <th align="left">Id</th>
    <th align="left">Catalog</th>
    <th align="left">Sort id</th>
  </tr>
<?php if(isset($results)) : foreach($results as $row):?>
  <tr height="35" id="<?php echo "tr_data".$row -> id;?>" onmousemove ="show_action_bar(<?php echo $row -> id;?>)" onmouseout="hide_action_bar(<?php echo $row -> id;?>)">
    <td><input type="checkbox" name="delete_id[]" value="<?php echo $row->id;?>"></td>
    <td><?php echo $row->id;?></td>
    <td width="200px"><?php echo $row->catalog_name;?><br/>
    	<div id="<?php echo 'bar'.$row -> id;?>">
    		<a href="#" onclick="show_quick_edit(<?php echo $row -> id;?>)">Quick edit</a> 
    		<?php echo anchor("catalog/Catalog_Controller/show/" . $row -> id, "Show"); ?>
    	</div>
    </td>
    <td><?php echo $row->sort_id;?></td>
  </tr>
  <tr id="<?php echo "tr".$row -> id;?>"> 
  	<td colspan="3">
  		<?php echo form_open("catalog/Catalog_Controller/quick_update"); ?>
  		<?php echo validation_errors();?>
  		<input type="hidden" name="id" id="id" value="<?php echo set_value('id', $row -> id); ?>"/>
  		<table>
		  <tr>
		    <td><label for="catalog_name">Catalog</label></td>
		    <td><input type="text" name="<?php echo 'catalog_name'.$row -> id;?>" id="<?php echo 'catalog_name'.$row -> id;?>" value="<?php echo set_value('catalog_name', $row -> catalog_name); ?>"/></td>
		  </tr>
		  <tr>
		    <td><label for="sort_id">Sort id</label></td>
		    <td><input type="text" name="<?php echo 'sort_id'.$row -> id;?>" id="<?php echo 'sort_id'.$row -> id;?>" value="<?php echo set_value('sort_id', $row -> sort_id); ?>"/></td>
		  </tr>
		  <tr>	
  			<td><input type="submit" value="Update"/></td>
  			<td><input type="button" value="Cancel" onclick="show_quick_edit(<?php echo $row -> id;?>)"/></td>
  		  </tr>
	</table>
	<?php echo form_close(); ?>
  	</td>
  </tr>
    <?php endforeach;?>
    <?php endif;?>
    <tr><td colspan="3" align="center"><?php echo $pagination_link; ?></td></tr>
</table>
<input type="submit" name="delete" value="Delete" />
</form>

<script type='text/javascript' language='javascript'>
<?php
	foreach($results as $row) {
?>
show_quick_edit(<?php echo $row->id;?>);
hide_action_bar(<?php echo $row->id;?>);
<?php
}
?>
</script>